<template>
  <div class="login">
    <p>{{!isLogin?'模拟登陆云考勤':'登录成功，正在跳转...'}}</p>
    <div @click="login">登陆</div>
  </div>
</template>

<script>
import Store from '@/shared/store'

export default {
  name: 'Home',
  data() {
    return {
      isLogin: false
    }
  },
  created() {},
  methods: {
    login() {
      this.$axios.get('/open/loginTest?mobile=13567175139').then(() => {
        setTimeout(() => {
          this.isLogin = true
          setTimeout(() => {
            Store.commit(
              'setToken',
              'SESSION=a176e09f-5ec0-452f-b3d1-7285003ff0fc'
            )
            this.$router.push({ path: '/Home' })
          }, 1000)
        }, 800)
      })
    }
  }
}
</script>

<style lang="less" scoped>
.login {
  text-align: center;
  height: 100%;
  padding-top: 80px;
  background: linear-gradient(to right, #3a5f89, #02c5cb);
  color: #fff;
  p {
    font-size: 18px;
  }
  div {
    color: rgb(75, 75, 75);
    border-radius: 4px;
    border: 1px solid #cccccc;
    width: 120px;
    margin: 15px auto;
    font-size: 14px;
    padding: 2px 6px 3px;
    background-color: rgb(255, 255, 255);
    border-radius: 20px;
    border-style: solid;
    border-color: rgb(184, 215, 251);
    border-width: 2px;
    font-style: normal;
    font-weight: normal;
    text-align: center;
    cursor: pointer;
    line-height: 30px;
    height: 30px;
  }
}
</style>
